# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gtkd
pkgver=3.10.0
pkgrel=1
pkgdesc="D bindings for GTK+3 and related libraries"
url="https://gtkd.org"
arch="x86_64 aarch64" # ldc
license="LGPL-3.0-or-later"
makedepends="ldc ldc-runtime gstreamer-dev gtksourceview-dev libpeas-dev
	librsvg-dev vte3-dev"
options="!check"
subpackages="$pkgname-dev"
source="https://github.com/gtkd-developers/GtkD/archive/v$pkgver/gtkd-$pkgver.tar.gz
	install-t.patch
	"
builddir="$srcdir/GtkD-$pkgver"

prepare() {
	default_prepare

	# Fix the install location of pkgconfig files
	sed 's|$(DESTDIR)$(libdir)|$(DESTDIR)$(prefix)/$(libdir)|' -i GNUmakefile
}

build() {
	make shared LDFLAGS='-linker=bfd -link-defaultlib-shared'
}

package() {
	make LDFLAGS='-linker=bfd -link-defaultlib-shared' DESTDIR="$pkgdir" prefix=/usr \
		install-shared install-headers -j1
}

sha512sums="
1e75d6cbd278a065ce26b33320fe06cc7a30af8bd884c3c87abe799afaf9da8339d3c4470163b62ec8b70e8c540285b8c2c409c7b77423142a301f23ba37ff2e  gtkd-3.10.0.tar.gz
5f10507794ebeeb4fa441324d20f8427a2b1d062dd0d04cebd7a1c38b6727fcb38b8cf9296f6ec1574a192b96b876d0ce0074957c2643c7c660f0fe1ca447f86  install-t.patch
"
